import React, {
  Component
} from 'react'
import PropTypes from 'prop-types'
import {
  connect
} from './react-redux.js'
class Header extends Component {
  static contextTypes = {
    themeColor: PropTypes.object
  }
  render() {
    return ( <h1 style = {{  color: this.props.themeColor} }> React.js 小书 </h1>)
  }
}
const mapStateToProps = state => ({
  themeColor: state.themeColor
})

Header = connect(mapStateToProps)(Header)
// Header = connect(mapStateToProps,Header)
export default Header